<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<title>User Management</title>
</head>
<link rel="stylesheet" href="../../../resources/css/fw-edit.css"
	type="text/css">
<script src="../../../script/base.js"></script>

<body>
<f:view>
	<f:loadBundle basename="net.orange.conf.lang.fw" var="msg" />
	<h:form id="myForm">
		<h:inputHidden value="#{user.content.pk}" id="pk" />
		<h:inputHidden value="#{user.editMode}" id="editMode" />

		<h:panelGrid columns="2" rowClasses="content-title"
			style="width:100%;">
			<h:outputText value="#{msg.user_title}." />

			<h:panelGroup style="text-align:right">
				<h:commandButton value="#{msg.common_edit}" type="submit" id="cmdEdit"
					action="#{user.edit}" styleClass="button-normal"
					rendered="#{not user.editMode}" />

				<h:commandButton value="#{msg.common_save}" type="submit" id="cmdSave"
					action="#{user.save}" styleClass="button-normal"
					rendered="#{user.editMode}" />

				<h:outputText value="    " />
				<h:commandButton value="#{msg.common_cancel}" type="submit" id="cmdCancel"
					action="#{user.back}" styleClass="button-normal" />
			</h:panelGroup>
		</h:panelGrid>

		<hr>


		<h:messages styleClass="content-message" />

		<h:panelGrid columns="2" styleClass="content-table"
			columnClasses="content-detail-title,content-detail">

			<h:outputLabel value="#{msg.common_pk}:" />
			<h:outputText value="#{user.content.pk}" />

			<h:outputLabel value="" />
			<h:outputLabel value="" />

			<h:outputLabel value="#{msg.user_title}:" />
			<h:inputText value="#{user.content.user_code}" id="user_code"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="#{msg.user_name}:" />
			<h:inputText value="#{user.content.user_name}" id="user_name"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="#{msg.user_loginno}:" />
			<h:inputText value="#{user.content.login_no}" id="login_no"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="#{msg.user_loginpwd}:" />
			<h:inputText value="#{user.content.login_pwd}" id="login_pwd"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="&nbsp;" />
			<h:outputLabel value="&nbsp;" />


			<h:outputLabel value="#{msg.user_email}:" />
			<h:inputText value="#{user.content.email}" id="email"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="#{msg.user_phone}:" />
			<h:inputText value="#{user.content.phone}" id="phone"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="#{msg.user_mobile}:" />
			<h:inputText value="#{user.content.mobile}" id="mobile"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="#{msg.user_fax}:" />
			<h:inputText value="#{user.content.fax}" id="fax"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="#{msg.user_address}:" />
			<h:inputText value="#{user.content.address}" id="address"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="&nbsp;" />
			<h:outputLabel value="&nbsp;" />


			<h:outputLabel value="#{msg.user_department}:" />
			<h:selectOneMenu value="#{user.deparment_code}" id="parent_dept_code"
				disabled="#{not user.editMode}">
				<f:selectItems value="#{department.departments}" />
			</h:selectOneMenu>

			<h:outputLabel value="#{msg.user_group}:" />
			<h:selectManyListbox id="group_pks" value="#{user.group_pks}"
				disabled="#{not user.editMode}" size="4">
				<f:selectItems value="#{group.groups}" />
			</h:selectManyListbox>

			<h:outputLabel value="&nbsp;" />
			<h:outputLabel value="&nbsp;" />

			<h:outputLabel value="#{msg.user_description}:" />
			<h:inputText value="#{user.content.description}" id="description"
				disabled="#{not user.editMode}" />

			<h:outputLabel value="#{msg.user_blocked}:" />
			<h:selectOneMenu value="#{user.content.isstop}" id="isstop"
				disabled="#{not user.editMode}">
				<f:selectItems value="#{webhelper.booleans}" />
			</h:selectOneMenu>

			<h:outputLabel value="#{msg.user_homepage}:" />
			<h:selectOneMenu value="#{user.content.homepage}" id="homepage"
				disabled="#{not user.editMode}">
				<f:selectItems value="#{commoninfo.homepages}" />
			</h:selectOneMenu>
		</h:panelGrid>
	</h:form>
</f:view>
</body>
</html>
